# -*- coding: utf-8  -*-
#!/usr/local/bin/python

__author__ = 'yaojian'

from misc import get_sequence_item

class ConfigBase:
    MD5 = ""
    Unknown = 0
    DICT = [
        {"id" : Unknown,
         "name_zh" : "未知",
         "name_en" : "Unknown",},
    ]

    @classmethod
    def all_data(cls):
        return cls.DICT

    @classmethod
    def get(cls, _value, _key = "id", _default = None):
        return get_sequence_item(_seq = cls.all_data(), _key = _key, _value = _value) or _default